package com.whmw.mybatisplusdemo.config;

import com.baomidou.mybatisplus.core.incrementer.IdentifierGenerator;
import org.springframework.stereotype.Component;

/**
 * 自定义ID生成
 */
@Component
public class CustomIdGenerator implements IdentifierGenerator {
    @Override
    public Long nextId(Object entity) {
        return System.currentTimeMillis();
    }

    @Override
    public String nextUUID(Object entity) {
        return "hhh" + IdentifierGenerator.super.nextUUID(entity);
    }
}